<template>
  <el-tag v-if="currentStatusKey" :type="ETaskStatusType[currentStatusKey]">
    {{ currentStatusKey }}
  </el-tag>
</template>

<script setup lang="ts">
import { ETaskStatus, ETaskStatusType } from '@/components/statusShow/util'
import { computed } from 'vue'

/**
 * 任务状态展示
 */
const { status } = defineProps<{
  status: number | undefined
}>()

const currentStatusKey = computed(() => {
  if (status !== 0 && !status) {
    return null
  }
  return ETaskStatus[status] as keyof typeof ETaskStatus
})
</script>

<style scoped lang="scss"></style>
